FEDX-5172: Detect build readiness from webdev stdout#67
Merged
btr-rmconsole-2[bot] merged 3 commits intomasterfrom Apr 1, 2026
Merged
FEDX-5172: Detect build readiness from webdev stdout#67btr-rmconsole-2[bot] merged 3 commits intomasterfrom
btr-rmconsole-2[bot] merged 3 commits intomasterfrom
Conversation
d8ceb6a to
672fb6d
Compare
672fb6d to
cd17980
Compare
Switches WebdevServer from ProcessStartMode.inheritStdio to
ProcessStartMode.normal so that webdev stdout can be monitored.
Exposes a stdoutLines broadcast stream on WebdevServer; stderr
continues to be forwarded to the parent process.
ServeCommand listens to stdoutLines, forwarding each line to
stdout and watching for build_runner's completion signal
('Built with build_runner' / 'Failed to build with build_runner').
Once detected, it emits '[INFO] Succeeded after N seconds' on its
own line.
Also adds a test verifying the build-complete signal appears in
webdev stdout before the HTTP server becomes responsive.
cd17980 to
f45658e
Compare
Closed
SDK constraint is now >=3.0.0 so there is no need to test against 2.19.6.
Both workflows default to 2.19.6 if sdk is not specified; explicitly pass stable to keep CI on Dart 3.
robbecker-wf
approved these changes
Apr 1, 2026
Member
|
QA +1 CI passes on Dart stable. Internal testing shows existing scripts work. |
Member
|
@Workiva/release-management-p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With Dart 3 and newer webdev/build_runner versions, a line that the build/serve process previously emitted — which consumers used to detect readiness — is no longer output. This broke scripts in consumer repos that monitor for a readiness signal in webdev_proxy's output.
Solution
build_runnerreliably emits one of the following lines to webdev's stdout when the initial build finishes, regardless of verbose mode:Built with build_runner/jit in Xs; wrote N outputs.Failed to build with build_runner/jit in Xs; wrote N outputs.This PR switches
WebdevServertoProcessStartMode.normalto capture webdev's stdout, watches that stream for the build-complete signal, then emits[INFO] Succeeded after N secondson its own line — preserving compatibility with existing consumer scripts already monitoring for that string.Changes
WebdevServerusesProcessStartMode.normaland exposes astdoutLinesbroadcast stream; stderr is forwarded to the parent process unchangedServeCommandlistens tostdoutLinesto forward webdev output to the user and waits for the build-complete pattern before emitting the readiness signaltest/webdev_ready_detection_test.dartwith two tests: one verifyingWebdevServer.stdoutLinesemits the build-complete signal before the HTTP server is responsive, and one verifyingServeCommandemits'Succeeded after'in its outputKnown tradeoff
ProcessStartMode.normalcauses webdev to detect a pipe rather than a TTY, changing its progress output from\r-based in-place rewrites to newline-separated lines. This is spammier for large projects during the initial build. Feedback welcome on whether this tradeoff is acceptable.Test plan
dart test test/webdev_ready_detection_test.dart— verifies the build-complete signal appears inWebdevServer.stdoutLinesand thatServeCommandemits'Succeeded after'dart test test/webdev_server_test.dart— existing serve test still passesdart pub global activate -sgit https://github.com/Workiva/webdev_proxy.git --git-ref dart3_detect_ready_deterministicin a consumer project and confirm[INFO] Succeeded after N secondsis emitted after the initial build